const Admin = require("./models/Admin");

exports.login = async (loginInfo) => {
    const ins = await Admin.findOne({
        where: {
            loginId: loginInfo.loginId,
            loginPwd: loginInfo.loginPwd
        }
    });
    if (ins) {
        return ins.toJSON();
    }
    return null;
}

exports.updateAdmin = async (adminInfo) => {
    return await Admin.update(adminInfo, {
        where: {
            loginId: adminInfo.loginId
        }
    });
}
